package com.yanqu.road.server.cmd.cookboy.process3;

import com.yanqu.road.pb.cookboy.CookBoyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cookboy.CrossCookBoyMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_COOK_BOY3_COOKER_REQ, desc = "小当家第3阶段同步cooker")
public class CrossCookerSyncCmd extends CrossCommand {

    private long userId;
    private int activityId;
    private long homeUserId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CookBoyProto.CookBoy3CookerReqMsg reqMsg = CookBoyProto.CookBoy3CookerReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        activityId = reqMsg.getActivityId();
        homeUserId = reqMsg.getUserId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossCookBoyMgr.syncCooker3Table(activityId,serverId,userId,homeUserId);
    }

    @Override
    public void sendData() {

    }

}
